"""
债券数据模型校验
"""

from datetime import date
from pydantic import BaseModel

class BondDailySchema(BaseModel):
    trade_date: date
    price: float
    yield_rate: float
    volume: float
    amount: float
    accr_int: float

    class Config:
        orm_mode = True

class BondInfoSchema(BaseModel):
    code: str
    name: str
    type: str
    issue_date: date
    maturity_date: date
    coupon_rate: float
    issuer: str

    class Config:
        orm_mode = True

class YieldCurveSchema(BaseModel):
    duration: str
    yield_rate: float
    date: date